package com.spc;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;

import org.springframework.web.client.RestTemplate;

/**
 * @author smark
 */
@SpringBootApplication
@EnableDiscoveryClient//eureka 也可以是zookeeper nocas
@EnableCircuitBreaker //开启hystirx的降级和熔断功能
//@EnableEurekaClient  -只能是eureka
public class OrderApplication {

    public static void main(String[] args){
        SpringApplication.run(OrderApplication.class);
    }

    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
